﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Tasks.ascx.cs" Inherits="Higer.SharePoint.UserControls.Tasks" %>
<%@ Import Namespace="System.ComponentModel"%>


<style type="text/css">
        body
{
    font-size: 11pt;
    font-family: 宋体;
}
.mainTitle
{
    font-size: 12pt;
    font-weight: bold;
    font-family: 宋体;
}
.commonText
{
    font-size: 11pt;
    font-family: 宋体;
}
.littleMainTitle
{
    font-size: 10pt;
    font-weight: bold;
    font-family: 宋体;
}
.TopTitle
{
    border: 0px;
    font-size: 10pt;
    font-weight: bold;
    text-decoration: none;
    color: Black;
    display: inline-block;
    width: 100%;    
}
.SelectedTopTitle
{
    border: 0px;
    font-size: 10pt;
    text-decoration: none;
    color: Black;
    display: inline-block;
    width: 100%;
    background-color: White;
}
.ContentView
{
    border: 0px;
    padding: 3px 3px 3px 3px;
    background-color: White;
    display: inline-block;
    width: 390px;
}
.SepBorder
{
    border-top-width: 0px;
    border-left-width: 0px;
    font-size: 1px;
    border-bottom: Gray 1px solid;
    border-right-width: 0px;
}
.TopBorder
{
    border-right: Gray 1px solid;
    border-top: Gray 1px solid;
    background: #DCDCDC;
    border-left: Gray 1px solid;
    color: black;
    border-bottom: Gray 1px solid;
}
.ContentBorder
{
    border-right: Gray 1px solid;
    border-top: Gray 0px solid;
    border-left: Gray 1px solid;
    border-bottom: Gray 1px solid;
    height: 100%;
    width: 100%;
}
.SelectedTopBorder
{
    border-right: Gray 1px solid;
    border-top: Gray 1px solid;
    background: none transparent scroll repeat 0% 0%;
    border-left: Gray 1px solid;
    color: black;
    border-bottom: Gray 0px solid;
}

.Tabboxcontent td{line-height:18px; font-size:12px;padding-right:10px;}
.Tabboxcontent td a{color:#333; text-decoration:none;}
.Tabboxcontent td a:hover{color:Green;}
.more{ display:block; text-align:right;}
.more span{font-size:12px;background:url(/_layouts/2052/imagesnews/listicon-01.gif) no-repeat 2px 2px;color:#3399CC;padding-left:10px;padding-right:15px;}
.more span a{color:#3399CC;text-decoration:none;}
.more span a:hover{color:#ff0000;}
.datecss{padding-left:15px;}


.myredcss a{color:red; text-decoration:none;}
.myredcss a:hover{color:red;}
.myredcss {font-size:12px;color:red; }

.mybluecss a{color:Blue;text-decoration:none;}
.mybluecss a:hover{color:red;}
.mybluecss {font-size:12px;color:Blue;}

.mygreencss a{color:Green;text-decoration:none;}
.mygreencss a:hover{color:red;}
.mygreencss {font-size:12px;color:Green; }

.myblackcss a{color:Black; text-decoration:none;}
.myblackcss a:hover{color:red;}
.myblackcss {font-size:12px;color:Black;}

.labelhander { }

</style>

<script type="text/javascript" language="javascript">
function gotoWaitHandle()
{
    window.open("http://www.klsz.com/webflow/flow/waithandle2.asp");
}
function gotoOrderTask()
{
    window.open("http://www.klsz.com/webflow/flow/waithandle2.asp");
}
</script>

<div>  
<asp:ScriptManager ID="TasksTabsScriptManager" runat="server">
</asp:ScriptManager>
      <table id="MainTable" height="95%" cellspacing="0" cellpadding="0" width="550px" border="0">
            <tr>
                <td>
                    <asp:UpdatePanel ID="TitleUpdatePanel" runat="server">
                        <ContentTemplate>
                            <table id="TopTable" runat="server" cellspacing="0" cellpadding="0" width="100%" border="0">
                                <tr style="height: 22px">
                                    <td class="SelectedTopBorder" id="CellWaitHandle" align="center" width="100">
                                        <asp:LinkButton ID="LBViewWaitHandle" runat="server" CssClass="TopTitle" OnClick="LBViewWaitHandle_Click">待办事项</asp:LinkButton>
                                    </td>
                                    <td id="CellWaitHandleBlank" class="SepBorder" width="2px">
                                        &nbsp;</td>
                                    <td class="TopBorder" id="CellMyTask" align="center" width="100">
                                        <asp:LinkButton ID="LBViewMyTask" runat="server" CssClass="TopTitle" OnClick="LBViewMyTask_Click">我的任务</asp:LinkButton>
                                    </td>
                                    <td id="CellMyTaskBlank" class="SepBorder" width="2px">
                                        &nbsp;</td>
                                    <td class="TopBorder" id="CellOrderTask" align="center" width="200">
                                        <asp:LinkButton ID="LBViewOrderTask" runat="server" CssClass="TopTitle" OnClick="LBViewOrderTask_Click">特殊订单技术任务</asp:LinkButton>
                                        
                                    </td>
                                    <td class="SepBorder">
                                        &nbsp;</td>
                                </tr>
                            </table>
                             </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:UpdatePanel ID="UpdatePanelContent" runat="server">
                        <ContentTemplate>
                            <table class="ContentBorder" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td valign="top" style="height:200px">
                                        <asp:MultiView ID="MVMain" runat="server" ActiveViewIndex="0">
                                            <asp:View ID="ViewMyTask" runat="server">
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td>
                                                            <br />
                                                            <div id="divMyTask" runat="server">
                                                            <asp:GridView ID="gvMyTask" runat="server" AutoGenerateColumns="false" 
                                                                ShowHeader="false" GridLines="None" AllowPaging="True" 
                                                                onrowdatabound="gvMyTask_RowDataBound" Width="100%">
                                                                <HeaderStyle CssClass="myHeaderStyle" />
                                                                <PagerSettings Visible="False" />
                                                                <RowStyle CssClass="Tabboxcontent" />
                                                                <AlternatingRowStyle CssClass="Tabboxcontent" />                       
                                                                <Columns>
                                                                        <asp:TemplateField HeaderText="img" ItemStyle-Width="15px" ItemStyle-VerticalAlign="Middle">
                                                                            <ItemTemplate>
                                                                                &nbsp;<img src="/_layouts/2052/imagesnews/icon.gif" style="padding-bottom:2px" />
                                                                            </ItemTemplate>
                                                                            <ItemStyle Width="15px" />
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="taskName" >
                                                                            <ItemTemplate>
                                                                                <asp:Literal runat="server" ID="LiteralProjectName" Text='<%# DataBinder.Eval(Container,"DataItem.proj_name")%>'></asp:Literal>：
                                                                                <a href="<%#DataBinder.Eval(Container,"DataItem.task_url") %>" target="_blank" title='<%# DataBinder.Eval(Container, "DataItem.task_name") %>'>
                                                                                  <asp:Label ID="lblTaskTitle" runat="server" Text='<%#GetTaskTitle(DataBinder.Eval(Container, "DataItem.task_name").ToString(), 43)%>'>
                                                                                  </asp:Label> 
                                                                                </a>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                       <asp:TemplateField  HeaderText="date" ItemStyle-CssClass="datecss">
                                                                         <ItemTemplate>
                                                                              <asp:Literal runat="server" ID="LiteralDate" Text='<%# GetDate(DataBinder.Eval(Container,"DataItem.task_start_date").ToString(), DataBinder.Eval(Container,"DataItem.task_end_date").ToString())%>'></asp:Literal>
                                                                         </ItemTemplate>
                                                                           <ItemStyle CssClass="datecss" />
                                                                        </asp:TemplateField>
                                                                        <asp:BoundField DataField="task_start_date" HeaderText="taskstratdate" />
                                                                        <asp:BoundField DataField="task_end_date" HeaderText="taskenddate"  />
                                                                </Columns>
                                                            </asp:GridView>
                                                            </div>
                                                            <div>
                                                                <asp:Label ID="lblMyTaskMessage" runat="server" Text="" ForeColor="Red" Visible="false"></asp:Label>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">
                                                            <div class=" more">
                                                                <br />
                                                                <span id="moreSpanMyTask" runat="server" visible="false">
                                                                    <a href="./moreMyTask.aspx">更多...</a>
                                                                </span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>                               
                                            </asp:View>
                                            
                                            <asp:View ID="ViewWaitHandle" runat="server">
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td>
                                                            <br />
                                                            <div id="divWaitHandle" runat="server" onclick="gotoWaitHandle()" style="cursor:hand">
                                                            <asp:GridView ID="gvWaitHandle" runat="server" AutoGenerateColumns="false" 
                                                                ShowHeader="false" GridLines="None" AllowPaging="True" Width="100%" >
                                                                <HeaderStyle CssClass="myHeaderStyle" />
                                                                <PagerSettings Visible="False" />
                                                                <RowStyle CssClass="Tabboxcontent" />
                                                                <AlternatingRowStyle CssClass="Tabboxcontent" />                       
                                                                <Columns>
                                                                        <asp:TemplateField HeaderText="img" ItemStyle-Width="15px">
                                                                            <ItemTemplate>
                                                                                &nbsp;<img src="/_layouts/2052/imagesnews/icon.gif" style="padding-bottom:2px" />
                                                                            </ItemTemplate>
                                                                            <ItemStyle Width="15px" />
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="subject" >
                                                                            <ItemTemplate>
                                                                                <asp:Literal runat="server" ID="LiteralFormName" Text='<%# DataBinder.Eval(Container,"DataItem.formname")%>'></asp:Literal>：
                                                                                <asp:Label ID="labSubject" runat="server" CssClass="labelhander" Text='<%#GetTaskTitle(DataBinder.Eval(Container, "DataItem.subject").ToString(),43)%>' ToolTip='<%# DataBinder.Eval(Container, "DataItem.subject") %>'></asp:Label>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:BoundField DataField="appdate" HeaderText="appdate" />
                                                                </Columns>
                                                            </asp:GridView>
                                                            </div>
                                                            <div>
                                                                <asp:Label ID="lblWaitHandleMessage" runat="server" Text="" ForeColor="Red" Visible="false"></asp:Label>
                                                                
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">
                                                            <div class=" more">
                                                                <br />
                                                                <span id="moreSpanWaitHandle" runat="server" visible="false">
                                                                    <a href="./moreWaitHandle.aspx">更多...</a>
                                                                </span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                                
                                            </asp:View>
                                            
                                            <asp:View ID="ViewOrderTask" runat="server">
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td>
                                                            <br />
                                                            <div id="divOrderTask" runat="server" style="cursor:hand" onclick="gotoOrderTask()">
                                                                
                                                            
                                                            <asp:GridView ID="gvOrderTask" runat="server" AutoGenerateColumns="false" 
                                                                ShowHeader="false" GridLines="None" AllowPaging="True" 
                                                                onrowdatabound="gvOrderTask_RowDataBound" Width="100%" >
                                                                <HeaderStyle CssClass="myHeaderStyle" />
                                                                <PagerSettings Visible="False" />
                                                                <RowStyle CssClass="Tabboxcontent" />
                                                                <AlternatingRowStyle CssClass="Tabboxcontent" />                       
                                                                <Columns>
                                                                        <asp:TemplateField HeaderText="img" ItemStyle-Width="15px">
                                                                            <ItemTemplate>
                                                                                &nbsp;<img src="/_layouts/2052/imagesnews/icon.gif" style="padding-bottom:2px" />
                                                                            </ItemTemplate>
                                                                            <ItemStyle Width="15px" />
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="subject" >
                                                                            <ItemTemplate>
                                                                                <asp:Literal runat="server" ID="LiteralOrderCode" Text='<%# DataBinder.Eval(Container,"DataItem.order_code")%>'></asp:Literal>
                                                                                &nbsp;(<asp:Literal runat="server" ID="LiteralItemModel" Text='<%# DataBinder.Eval(Container,"DataItem.item_model")%>'></asp:Literal>、<asp:Literal runat="server" ID="Literal4" Text='<%# DataBinder.Eval(Container,"DataItem.made_code")%>'></asp:Literal>)
                                                                                
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField  HeaderText="requestdate">
                                                                         <ItemTemplate>
                                                                              <asp:Literal runat="server" ID="LiteralRequestDate" Text='<%# GetRequestDate(DataBinder.Eval(Container,"DataItem.request_date").ToString())%>'></asp:Literal>
                                                                         </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField  HeaderText="firstlinedate">
                                                                         <ItemTemplate>
                                                                              <asp:Literal runat="server" ID="LiteralFirstLineDate" Text='<%# GetFristLineDate(DataBinder.Eval(Container,"DataItem.first_line_date").ToString())%>'></asp:Literal>
                                                                         </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        
                                                                        <asp:BoundField DataField="request_date" HeaderText="requestdate" />
                                                                </Columns>
                                                            </asp:GridView>
                                                            </div>
                                                            <div>
                                                                <asp:Label ID="lblOrderTaskMessage" runat="server" Text="" ForeColor="Red" Visible="false"></asp:Label>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">
                                                            <div class=" more">
                                                                <br />
                                                                <span id="moreSpanOrderTask" runat="server" visible="false">
                                                                    <a href="./moreOrderTask.aspx">更多...</a>
                                                                </span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:View>
                                        </asp:MultiView>
                                    </td>
                                </tr>
                            </table>
                      </ContentTemplate>
                    </asp:UpdatePanel>

                </td>
            </tr>
      </table>
</div>